<?php


namespace app\model;


class ShopAdmin extends BaseModel
{
    protected $hidden = [
        'password', 'salt'
    ];

    public function shop()
    {
        return $this->hasOne(Shop::class, 'id', 'shop_id');
    }

    public function validatePassword(String $password)
    {
        return $this->password == md5(md5($password).md5($this->salt));
    }
}